package book;

public class BookList {
    private static final int N = 10;
    private Book[] books= new Book[N];
    private int usedsize;// 记录书架上有多少本书
    public void setBooks(int pos,Book book){
        books[pos]= book;
    }

    public BookList() {
        books[0] = new Book("海底两万里","凡尔纳",50,"冒险");
        books[1] = new Book("钢铁是怎样练成的","尼古拉·奥斯特洛夫斯基",99,"励志");
        this.usedsize = 2;
    }

    public Book getBook(int pos) {
        return this.books[pos];
    }
    public void setBook(Book book){
        this.books[usedsize] = book;
    }
    public void setBook(int pos,Book book){
        this.books[pos] = book;
    }
    public int getUsedsize() {
        return usedsize;
    }

    public void setUsedsize(int usedsize) {
        this.usedsize = usedsize;
    }
}
